package com.mipo.springmvc.maximum.mybatis.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mipo.springmvc.maximum.mybatis.dao.UserDao;
import com.mipo.springmvc.maximum.mybatis.dao.impl.EasyMsgBindDao;
import com.mipo.springmvc.maximum.mybatis.model.UserModel;
import com.mipo.springmvc.maximum.mybatis.service.UserService;


@Service
public class UserServiceImpl implements UserService {
	@Autowired
	private UserDao userDao;
	@Autowired
	private EasyMsgBindDao easyMsgBindDao;
	public UserServiceImpl() {
		System.out.println("UserServiceImpl construct...");
	}
	
    @Override  
    public UserModel getUserById(int userId) {
    	System.out.println("xxxxxxxx");
    	UserModel user1 = userDao.selectByPrimaryKey(userId);
    	UserModel user2 = easyMsgBindDao.queryEasyMsgBind(userId);
    	System.out.println("fffff:"+user1.getUserName());
    	System.out.println("fffff2:"+user2.getUserName());
    	return user1;
    }
    
    @Override  
    public UserModel getUserById2(int userId) {
    	System.out.println("xxxxxxxx");
    	UserModel user = userDao.selectByPrimaryKey2(userId);
    	System.out.println("fffff:"+user.getUserName());
    	return user;
    }
    
}
